package com.engine.salary.service;

import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeListDTO;
import com.engine.salary.entity.taxagent.param.*;
import com.engine.salary.entity.taxagent.po.TaxAgentExtRangePO;
import com.engine.salary.entity.taxagent.po.TaxAgentManageRangePO;
import com.engine.salary.util.page.PageInfo;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 个税扣缴义务人的管理范围
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public interface TaxAgentManageRangeService  {

    /**
     * 根据查询条件查询分管理员的人员范围
     *
     * @param queryParam  查询条件
     * @param includeType 0-从范围中排除/1-关联人员范围
     * @return
     */
    PageInfo<TaxAgentManageRangeListDTO> listPageByParamAndIncludeType(TaxAgentSubAdminRangeQueryParam queryParam, Integer includeType);

    /**
     * 根据查询条件查询个税扣缴义务人的人员范围
     *
     * @param queryParam  查询条件
     * @param includeType 0-从范围中排除/1-关联人员范围
     * @return
     */
    PageInfo<TaxAgentManageRangeListDTO> listPageByParamAndIncludeType(TaxAgentRangeQueryParam queryParam, Integer includeType);

    List<TaxAgentManageRangePO> listByTaxAgentIdAndIncludeType(Long taxAgentId, Integer includeType);

    /**
     * 根据分管理员id集合查询范围列表
     *
     * @param taxAgentSubAdminIds
     * @return
     */
    List<TaxAgentManageRangePO> listBySubAdminIds(Collection<Long> taxAgentSubAdminIds);

    /**
     * 保存
     *
     * @param saveParam  保存参数
     */
    void save(TaxAgentRangeSaveParam saveParam);
    void edit(TaxAgentRangeSaveParam param);

    /**
     * 根据主键id删除管理范围
     *
     * @param ids
     */
    void deleteByIds(Collection<Long> ids);

    PageInfo<TaxAgentExtRangePO> listExt(TaxAgentRangeExtQueryParam param);

    /**
     * 保存外部人员范围
     * @param saveParam
     */
    void saveExtRange(TaxAgentManageRangeExtSaveParam saveParam);

    void deleteExtRange(Collection<Long> ids);


    /**
     * 根据个税扣缴义务人的id删除管理范围
     *
     * @param taxAgentIds 个税扣缴义务人的id
     */
    void deleteByTaxAgentIds(Collection<Long> taxAgentIds);

    void syncManageRange(List<Long> taxAgentIds,String index);

    /**
     * 人员范围导入
     * @param taxAgentImportParam
     */
    Map<String, Object> importData(TaxAgentImportParam taxAgentImportParam);
}
